package com.example.demo.Controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: H_tao_X
 * Date: 2022-11-24
 * Time: 11:34
 */

@Controller
@ResponseBody // 返回非静态页面
public class UserController {

    // 1. 获取日志对象
    private final static Logger log =
            LoggerFactory.getLogger(UserController.class);

    // 2. 打印日志
    @RequestMapping("/sayhi")
    public void sayHi() {
        log.trace("trace,微量日子");
        log.debug("debug,调试日志");
        log.info("普通日志");
        log.warn("warn，警告日志");
        log.error("error,错误日志");
    }
}
